﻿using D.Medicalcare.ErrorCode;
using D.Medicalcare.Write.API.Application.Commands.HeaEncyclopeCommand;

using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace D.Medicalcare.Write.API.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class HeaEncyclopeController : ControllerBase
    {

        private readonly IMediator mediator;

        public HeaEncyclopeController(IMediator mediator)
        {
            this.mediator = mediator;
        }

        /// <summary>
        /// 健康百科新增
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<APIResult<int>> AddHeaEncyclope(AddHeaEncyclopeCommand request)
        {

            return await mediator.Send(request);

        }
    }
}
